<!DOCTYPE html>
<html>
	<!-- Mirrored from www.zi-han.net/theme/hplus/ by HTTrack Website Copier/3.x [XR&CO'2014], Wed, 20 Jan 2016 14:16:41 GMT -->
	<head>
		<meta charset="utf-8">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<meta name="renderer" content="webkit">
		<meta http-equiv="Cache-Control" content="no-siteapp" />
		<title></title>
		<script src="jquery.min.js?v=2.1.4"></script>
	</head>
	<body>
		<div class="left sear_table">
      <form>
        <table class="table_info" cellspacing="0" cellpadding="0">
          <tr>
            <td class="td_name2" style="WIDTH: 125px" rowspan="6" colspan="2">附件</td>
            <td class="td_info" style="WIDTH: 350px; PADDING-LEFT: 15px" colspan="2" nowrap="nowrap">附件1 
            <input id="houseMaps1" style="WIDTH: 600px" type="file" name="myfile" /></td>
          </tr>
          <tr>
            <td class="td_info" style="WIDTH: 350px; PADDING-LEFT: 15px" colspan="2" nowrap="nowrap">附件2 
            <input id="houseMaps2" style="WIDTH: 600px" type="file" name="myfile" /></td>
          </tr>
          <tr>
            <td class="td_info" style="WIDTH: 350px; PADDING-LEFT: 15px" colspan="2" nowrap="nowrap">附件3 
            <input id="houseMaps3" style="WIDTH: 600px" type="file" name="myfile" /></td>
          </tr>
          <tr>
            <td class="td_info" style="WIDTH: 350px; PADDING-LEFT: 15px" colspan="2" nowrap="nowrap">附件4 
            <input id="houseMaps4" style="WIDTH: 600px" type="file" name="myfile" /></td>
          </tr>
          <tr>
            <td class="td_info" style="WIDTH: 350px; PADDING-LEFT: 15px" colspan="2" nowrap="nowrap">附件5 
            <input id="houseMaps5" style="WIDTH: 600px" type="file" name="myfile" /></td>
          </tr>
          <tr style="HEIGHT: 80px">
            <td class="td_info" style="PADDING-LEFT: 15px; PADDING-RIGHT: 15px">
              <font color="red" size="3">温馨提示：最多可同时上传 5 个文件，每个文件只允许上传60M 大小。 附件仅限于文件名
              <br />后缀为.jpg、.png、.gif、.bmp、.jpeg、.tiff、.svg的文件，禁止exe、bat等格式文件上传!</font>
            </td>
          </tr>
        </table>
      </form>
      <div id="file_name"></div>
    </div>
    <div class="left oper_box" style="MARGIN-TOP: 30px">
      <table align="center">
        <tbody>
          <tr>
            <td style="WIDTH: 100px">
              <input onclick="post_data()" class="but_submit" type="button" value="提 交" />
            </td>
          </tr>
        </tbody>
      </table>
    </div>
	
		<script type="text/javascript">
			var url_p = "https://124.71.168.14/cdi_CenterData/getdata.jsp";
			
			/*
			$.ajax({
				type: "GET",
				async: true,
				url: url_p,
				data:{
					sub_code:"8A0731CC39614C90A5D474BC17253713",
					sub_usercode:"414A6DB3BBE6419DA3768E6E25127310",
					session_id:"",
					param_name:"A01_TEST",
					param_value1:"1",
					delay_data:"1",
					delay_code:"414A6DB3BBE6419DA3768E6E25127310"
				},
				//跨域请求的URL
				dataType: "jsonp",
				jsonp: "jsoncallback",
				jsonpCallback: "data_result",
				success: function(data) {
				},
				error: function() {
				if(confirm("网络故障，请刷新网络"))
					window.location.reload();
				},
				// 请求完成后的回调函数 (请求成功或失败之后均调用)
				complete: function(XMLHttpRequest, textStatus) {
				}
			});*/

			function data_result(input_data)
			{
				//alert(input_data);
				document.write(JSON.stringify(input_data));
			}
			
			function post_data() {	
				var formData = new FormData(document.querySelector("form")); //获取form值
				$.ajax({
					url: "https://124.71.168.14/cdi_CenterData/uploadFile",
					type: "POST",
					data: formData,
					processData: false, // 不处理数据
					contentType: false, // 不设置内容类型
					success: function (input) {
						data2 = $.parseJSON(input).A01_UpLoadFile;
						var v_file1 = "";
						var v_file2 = "";
						var v_file3 = "";
						var v_file4 = "";
						var v_file5 = "";
						$.each(data2, function (i, obj) {
							if (i == 0)
							{
								v_file1 = obj.newFileName;
							}
							else if (i == 1)
							{
								v_file2 = obj.newFileName;
							}
							else if (i == 2)
							{
								v_file3 = obj.newFileName;
							}
							else if (i == 3)
							{
								v_file4 = obj.newFileName;
							}
							else if (i == 4)
							{
								v_file5 = obj.newFileName;
							}
							
							$("#file_name").append(obj.newFileName+"<br>");
						});
					}
				});
			}
		</script>
	</body>
</html>